package com.ssy.lingxi.scheduler.listener;

import com.ssy.lingxi.scheduler.service.IScheduleTaskNotifyService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 永久任务执行接口
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-10
 */
@Component
@DisallowConcurrentExecution
public class PermanentJob implements Job {
    @Resource
    private IScheduleTaskNotifyService scheduleTaskNotifyService;

    @Override
    public void execute(JobExecutionContext context) {
        scheduleTaskNotifyService.notifyPermanentTask(context.getTrigger(), context.getJobDetail());
    }
}
